package com.mobileshop.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class YAdress extends Model<YAdress>{
	public final static YAdress dao=new YAdress();
	
	public List<YAdress> findAddressByCustomerCode(String customercode){
		return find("select * from t_address where customercode='"+customercode+"' ");
	}
	
	/**
	 * the method is function for selecting all records of address by code
	 * @param code is a identify of an address
	 * @return a address object
	 * @author yehuan
	 */
	public YAdress findAddressByCode(String code){
		return findFirst("select * from t_address where code=? ",code);
	}
}
